In [1]:
import sys
import numpy as np
import pandas as pd
import seaborn as sns
sns.set_theme()
In [2]:
results_folder = 'mmvec_major_taxa_scrambled'
results_base_name = 'latent_dim_3_input_prior_1.00_output_prior_1.00_beta1_0.90_beta2_0.95'
In [3]:
table = pd.read_table(results_folder + '/' + results_base_name + '_ranks.txt', index_col=0)
table.head()
Out[3]:
Propionibacteriaceae Staphylococcus caprae or capitis Staphylococcus epidermidis Staphylococcus hominis Other Staphylococci Polyomavirus HPyV6 Polyomavirus HPyV7 Merkel Cell Polyomavirus Malasseziaceae Corynebacteriaceae Micrococcaceae Other families
featureid
X940001 0.108002 0.281476 0.230751 -0.088645 0.325523 0.159858 0.003797 0.040958 0.541223 0.191130 0.089953 0.273742
X940002 -0.311842 -0.030911 0.145908 -0.223350 0.145753 0.025062 -0.045640 0.148346 -0.102332 0.175697 -0.079407 0.127062
X940005 -0.144484 -0.046149 -0.087393 -0.239615 -0.052742 -0.087412 -0.162386 -0.153883 0.000429 -0.073136 -0.126851 0.190019
X940007 0.219706 0.499016 0.520032 0.120489 0.626079 0.455443 0.365660 0.403363 0.544929 0.532255 0.324215 0.925777
X940010 0.497619 0.113296 0.059617 0.605515 -0.038072 0.152955 0.305821 0.190868 0.073865 0.026769 0.315798 -0.430855
In [4]:
table['Selected'] = np.isin(table.index,
                            ['X940203', 'X940589', 'X940625', 'X940925', 'X940936', 'X942191',
                             'X942237', 'X950023', 'X950028', 'X950056', 'X950157', 'X950173',
                             'X950193', 'X950225', 'X950228', 'X950233', 'X950254', 'X950396',
                             'X950485', 'X950584', 'X950661', 'X950999', 'X960035', 'X960242',
                             'X960306', 'X960421', 'X960463', 'X960465', 'X960712', 'X960726',
                             'X960934', 'X961553', 'X961686', 'X970018', 'X970091', 'X970092',
                             'X970232', 'X970283', 'X970327', 'X970342', 'X970633', 'X970680']
                           )
table.sort_values('Selected', inplace=True)
sns.relplot(
    table,
    y='Propionibacteriaceae', x='Staphylococcus epidermidis', hue='Selected'
)
Out[4]:
<seaborn.axisgrid.FacetGrid at 0x7fa01ea0b410>
In [5]:
sns.pairplot(table, hue='Selected')
Out[5]:
<seaborn.axisgrid.PairGrid at 0x7fa01ea2c810>
In [6]:
for i in table.columns[:-1]:
    sns.displot(table, x=i, hue='Selected', multiple='stack')